import java.util.Scanner;
//输入整数取整数的每一位
public class J10123 {
    public static void main(String[] args) {
        Scanner zhengshu = new Scanner(System.in);
        while(zhengshu.hasNextInt()) {
            int a = zhengshu.nextInt();
            int tmp = a;
            while(tmp != 0){
                int n;
                n = tmp % 10;
                System.out.println(n);
                tmp /= 10;
            }

        }

    }


}
